﻿// <copyright file="DataTableExtensions.cs" company="Edge Extensions Project">
// Copyright (c) 2009 All Rights Reserved
// </copyright>
// <author>Kevin Nessland</author>
// <email>kevinnessland@gmail.com</email>
// <date>2009-08-06</date>
// <summary>Contains DataTable extension methods.</summary>
namespace Edge.Extensions.Data
{
    using System;
    using System.Collections.Generic;
    using System.Data;
    using System.Linq;
    using System.Text;

    /// <summary>
    /// Provides various DataTable-related extensions.
    /// </summary>
    public static class DataTableExtensions
    {
        /// <summary>
        /// Creates and adds a System.Data.DataColumn object to the System.Data.DataColumnCollection.
        /// </summary>
        /// <param name="table">DataTable to add the columns to.</param>
        /// <param name="columnName">Name of the column to add.</param>
        /// <returns>The new column.</returns>
        public static DataColumn AddColumn(this DataTable table, string columnName)
        {
            DataColumn column = new DataColumn(columnName);
            table.Columns.Add(column);

            return column;
        }
    }
}
